package com.atguigu.gmall.publisher.mapper;

import com.atguigu.gmall.publisher.bean.TestScorePartBean;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TestScorePartMapper {
    @Select("select\n" +
            "    sum(goodCt) good,\n" +
            "    sum(passCt) pass,\n" +
            "    sum(noPassCt) noPass\n" +
            "from dws_test_score_part_count_window\n" +
            "where toYYYYMMDD(stt) = #{date}\n" +
            "group by toYYYYMMDD(stt);")
    List<TestScorePartBean> selectTestScorePartBean(@Param(value = "date")Integer date);

}
